translator.plugin("detect", {
  
  serviceFilter : function (filter, service) {
    return filter.type in service;
  },
  
  method : function (options) {
    options.services && options.services.shift();
    options.services = options.services || translator.getServices({type : "detect"});
    
    var s = options.services[0];    
    
    Mozkit.http.send({
      url : s.detect.url,
      method : s.detect.method,
      dataType : s.detect.dataType,
      requestBody : Mozkit.object.mask(options, s.detect.params),
      callBack : function ( data ) {        
        var response = s.detect.get.apply(s, [data]);
        response && options.callBack( response ) || !response && this.error(data);
      },
      error : function (error) {
        options.services.length > 1 && translator.plugins.detect.method(options) || error && options.error(error);
      }
    });
  }
});
